<%--
  Created by IntelliJ IDEA.
  User: 17628
  Date: 2021/4/22
  Time: 18:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
    <head>
        <!-- 头部 start -->
        <script>
            $(function () {
                //查询用户信息
                $.get("user/findOne",{},function (data) {
                    //{uid:1,name:'李四'}
                    var msg = "欢迎回来，"+data.name;
                    $("#span_username").html(msg);
                });
            });
        </script>
    </head>
    <body>
        <header>
            <h1 style="background-color: #2b669a;width: 100%;height: 100px"></h1>
            <div class="shortcut" style="width: 100%">
                <!-- 未登录状态  -->
                <div class="login_out" style="margin-right: 50px">
                    <a href="login.jsp">登录</a>
                    <a href="register.jsp">注册</a>
                </div>
                <!-- 登录状态  -->
                <div class="login">
                    <span id="span_username"></span>
                    <a href="myfavorite.jsp" class="collection">我的收藏</a>
                    <a href="javascript:location.href='exitServlet';">退出</a>
                </div>
            </div>
        </header>
    </body>
</html>
